<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../jstl/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="keywords" content="OVVI OTA Manager">
<meta name="description" content="OVVI OTA Manager">
<title>产品管理</title>
<%@ include file="../jstl/common_static_resources.jsp"%>
<script type="text/javascript" src="/static/web/js/role/modify.js"></script>
</head>
<body>
	<div class="page-container page-container-add">
		<form class="form form-horizontal" id="form-add" action="/role/save" method="post">
			<input type="hidden" value="${role.id }" name="id" /> <input type="hidden" value="${role.addtime }" name="addtime" />
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>角色名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${role.roledesc }" placeholder="角色名" id="roledesc" name="roledesc">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>角色编码：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${role.rolename }" placeholder="角色编码" id="rolename" name="rolename">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否启用：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box"> <select name="enable" class="select">
							<option value="1" <c:if test="${role.enable }">selected</c:if>>启用</option>
							<option value="0" <c:if test="${not role.enable }">selected</c:if>>禁用</option>
					</select>
					</span>
				</div>
			</div>
			<!-- 超级管理员默认所有权限 -->
			<c:if test="${role.id ne 1 }">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>所有权限：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box"> <c:forEach items="${role.permissions }" var="permission" varStatus="index">
								<input type="checkbox" name="checkedPermissions" value="${permission.id }" id="ck_${permission.id }" <c:if test="${permission.checked }">checked</c:if> />
								<label for="ck_${permission.id }">${permission.name }</label>
							</c:forEach>
						</span>
					</div>
				</div>
			</c:if>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button class="btn btn-primary radius" type="submit">
						<i class="Hui-iconfont">&#xe632;</i> 保存并提交
					</button>
					<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		function reinitIframe() {
			var iframes = $('iframe').get();
			for (var i = 0, j = iframes.length; i < j; i++) {
				try {
					var iframe = iframes[i];
					var bHeight = $('.page_container', iframe.contentWindow.document.body).outerHeight();
					iframe.height = bHeight + 20;
				} catch (ex) {
				}
			}
		}
	</script>
</body>
</html>